package com.pay.cloud;

import java.util.HashMap;
import java.util.Map;

public abstract class KeyCodeFactory {
    private static final Map<Integer, KeyInfo> keyInfos = new HashMap<>();
    static {
        for (KeyInfo info : KeyInfo.values()) {
            keyInfos.put(info.getCode(), info);
        }
    }
    public static KeyInfo getKeyInfo(int keyCode) {
            return keyInfos.get(keyCode);
    }
}
